package com.woniu.carrent.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.woniu.carrent.mapper.TCarbindMapper;
import com.woniu.carrent.mapper.TCartypeMapper;
import com.woniu.carrent.pojo.TCarbrand;
import com.woniu.carrent.pojo.TCartype;
import com.woniu.carrent.util.ResultMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/carTpye")
@CrossOrigin
@SaCheckLogin
public class CarTpyeController {
    @Autowired
    private TCartypeMapper CarTpyeService;
    @Autowired
    private TCarbindMapper CarBrandService;
    /**
     * 查询所有车辆类型
     * @return
     */
    @RequestMapping("/selectCarTpye")
    public ResultMessage selectCarTpye(){
        List<TCartype> list = CarTpyeService.selectList(null);
        return ResultMessage.success(list);
    }
    /**
     * 查询所有车辆品牌
     * @return
     */
    @RequestMapping("/selectCarBrand")
    public ResultMessage selectCarBrand(){
        List<TCarbrand> list = CarBrandService.selectList( null);
        return ResultMessage.success(list);
    }


}
